using System;
using System.Collections.Generic;
using System.Text;

namespace Sandia.MVCFramework.Request
{
    /// <summary>
    /// Abstract implementation of IRequestParameter that provides
    /// facilities for initializing and working with a
    /// request parameter
    /// </summary>
    public abstract class AbstractStandardRequestParameter: IRequestParameter
    {
        /// <summary>
        /// Name of the request parameter
        /// </summary>
        string name;

        /// <summary>
        /// Data for the request parameter
        /// </summary>
        object data;

        /// <summary>
        /// Default constructor; initializes name of request
        /// parameter
        /// </summary>
        public AbstractStandardRequestParameter()
        {
            this.name = this.initName();            
        }

        /// <summary>
        /// Initializes name of the request parameter
        /// </summary>
        /// <returns>Name of the request parameter</returns>
        protected abstract string initName();

        #region IRequestParameter Members

        /// <summary>
        /// Name of the request parameter
        /// </summary>
        public string Name
        {
            get { return this.name; }
        }

        /// <summary>
        /// Data for the request parameter
        /// </summary>
        public object Data
        {
            get { return this.data; }
            set { this.data = value; }
        }

        #endregion
   }
}
